package com.example.demo.sample;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/user")
//localhost:8080/user/list
public class UserController {
    @Autowired
    private UserMapper userMapper;
    @GetMapping("/list")
    public Result<List<User>> getuserlist() {
        System.out.println(("----- selectAll method test ------"));
        List<User> userList = userMapper.selectList(null);
        Result<?> result=new Result<>();
        return Result.OK(userList);

    }
}
